package com.example.gulimall.authserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/*
    核心原理
    1、导入EnableRedisHttpSession的依赖
    2、EnableRedisHttpSession导入RedisHttpSessionConfiguration的配置
        1 【SessionRepository】===> 【RedisOperationSessionRepository】===> Redis操作session session的增删改查封装类
        2 sessionRepositoryFilter===> Filter：session过滤器，每个请求都必须经过filter
            1 创建时就自动从容器获取SessionRepository
            2 原始的request和response都被包装
            3 获取session request.getSession
            4 wrappedRequest.getSession()===>SessionReposity中获取【即Redis】

    自动续期：redis中的有过期时间
*/

@EnableRedisHttpSession //整合spring
@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient
public class GulimallAuthServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class, args);
    }

}
